home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / dbase / db2prg.zip / DB2PRG.PRG
Text File  |  1991-06-30  |  20KB  |  544 lines

  1. *  ╓──────────────────────────────────────────────────────────────────╖
  2. *  ║ DB2PRG.PRG - Automatic DBF file creation for FoxBASE+ and FoxPro ║
  3. *  ║              Version 2.1   6/30/1991                             ║
  4. *  ╙──────────────────────────────────────────────────────────────────╜
  5.  
  6. *  ╓─────────────────────────────────╖
  7. *  ║   SOFTWARE LICENSE AGREEMENT    ║
  8. *  ╙─────────────────────────────────╜
  9.  
  10. *  DB2PRG is not public domain or free software.  If you 
  11. *  continue using DB2PRG after a 30 day trial period, you 
  12. *  must register for a license to use DB2PRG.
  13.  
  14. *  To register, send $10 (Ten dollars U.S.) directly to the
  15. *  author:   (90 day unconditional money back guarantee)
  16.  
  17. *  Carlos Berguido         Inquiries:
  18. *  1722 Capella Court      Voice phone 707 / 762-9067
  19. *  Petaluma, CA 94954      Compuserve  72411,1071
  20.  
  21. *  Please include your name, address, and DB2PRG version
  22. *  number.  You will receive the latest version of DB2PRG
  23. *  INCLUDING ALL SOURCE CODE on a 5¼ inch diskette.
  24.  
  25. *  DB2PRG.PRG is a "shareware program" and is provided at no charge 
  26. *  to the user for evaluation.  Feel free to share it with your
  27. *  friends, but please do not give it away altered or as part of
  28. *  another system.  The essence of "user-supported" software is to
  29. *  provide personal computer users with quality software without
  30. *  high prices, and yet to provide incentive for programmers to
  31. *  continue to develop new products.  
  32.  
  33. *  If you find this program useful and find that you are using
  34. *  DB2PRG and continue to use DB2PRG after a 30 day trial period,
  35. *  you must make a registration payment of $10.00 to Carlos
  36. *  Berguido.  The $10.00 registration fee will license one copy for
  37. *  use on any one computer at any one time.
  38.  
  39. *  You must treat this software just like a book.  For example, this
  40. *  software may be used by any number of people and may be freely
  41. *  moved from one computer location to another.  However, two or
  42. *  more computers must not be running DB2PRG at the same time with
  43. *  only a single registration, just as one copy of a book cannot be
  44. *  read by two different persons at the same time.
  45.  
  46. *  Commercial users of DB2PRG must register and pay for their copies
  47. *  of DB2PRG within 30 days of first use or their license is
  48. *  withdrawn.  Site-License arrangements may be made by contacting
  49. *  Carlos Berguido.
  50.  
  51. *  Anyone distributing DB2PRG for any kind of remuneration must
  52. *  first contact Carlos Berguido at the address below for
  53. *  authorization.  This authorization will be automatically granted
  54. *  to distributors recognized by the (ASP) as adhering to its
  55. *  guidelines for shareware distributors, and such distributors may
  56. *  begin offering DB2PRG immediately (However Carlos Berguido must
  57. *  still be advised so that the distributor can be kept up-to-date
  58. *  with the latest version of DB2PRG).
  59.  
  60. *  You are encouraged to pass a copy of DB2PRG along to your friends
  61. *  for evaluation.  Please encourage them to register their copy if
  62. *  they find that they can use it.  All registered users will
  63. *  receive a copy of the latest version of the DB2PRG system on 
  64. *  diskette with source code and telephone support for 1 year.
  65.  
  66. *  ╓─────────────────────────────────╖
  67. *  ║           DISCLAIMER            ║
  68. *  ╙─────────────────────────────────╜
  69.  
  70. *  Users of DB2PRG must accept the following disclaimer of warranty:
  71. *
  72. *  "DB2PRG is supplied as is.  The author disclaims all warranties,
  73. *  expressed or implied, including, without limitation, the warranties
  74. *  of merchantability and of fitness for any purpose. The author 
  75. *  assumes no liability for damages, direct or consequential, which 
  76. *  may result from the use of DB2PRG."
  77.  
  78. *  ╓─────────────────────────────────╖
  79. *  ║     DEFINITION OF SHAREWARE     ║
  80. *  ╙─────────────────────────────────╜
  81.  
  82. *  Shareware distribution gives users a chance to try software
  83. *  before buying it.  If you try a Shareware program and continue
  84. *  using it, you are expected to register.  Individual programs
  85. *  differ on details - some request registration while others
  86. *  require it, some specify a maximum trial period.  With
  87. *  registration, you get anything from the simple right to continue
  88. *  using the software to an updated program with printed manual.
  89.   
  90. *  Copyright laws apply to both Shareware and commercial software,
  91. *  and the copyright holder retains all rights, with a few specific
  92. *  exceptions as stated below.  Shareware authors are accomplished
  93. *  programmers, just like commercial authors, and the programs are
  94. *  of comparable quality.  (In both cases, there are good programs
  95. *  and bad ones!)  The main difference is in the method of
  96. *  distribution.  The author specifically grants the right to copy
  97. *  and distribute the software, either to all and sundry or to a
  98. *  specific group.  For example, some authors require written
  99. *  permission before a commercial disk vendor may copy their
  100. *  Shareware.
  101.  
  102. *  Shareware is a distribution method, not a type of software.  You
  103. *  should find software that suits your needs and pocketbook,
  104. *  whether it's commercial or Shareware.  The Shareware system makes
  105. *  fitting your needs easier, because you can try before you buy. 
  106. *  And because the overhead is low, prices are low also.  Shareware
  107. *  has the ultimate money-back guarantee - if you don't use the
  108. *  product, you don't pay for it.
  109.  
  110. *  ╓─────────────────────────────────╖
  111. *  ║        THE ASP OMBUDSMAN        ║
  112. *  ╙─────────────────────────────────╜
  113.  
  114. *  Carlos Berguido is a member of the Association of 
  115. *  Shareware Professionals (ASP).  ASP wants to make sure
  116. *  that the shareware principle works for you. If you are
  117. *  unable to resolve a shareware-related problem with an ASP
  118. *  member by contacting the member directly, ASP may be able
  119. *  to help. The ASP Ombudsman can help you resolve a dispute
  120. *  or problem with an ASP member, but does not provide
  121. *  technical support for members' products. Please write to
  122. *  the ASP Ombudsman at 545 Grover Road, Muskegon, MI 49442-
  123. *  9427 or send a Compuserve message via CompuServe Mail to
  124. *  ASP Ombudsman 70007,3536"
  125.  
  126. *  ╓─────────────────────────────────╖
  127. *  ║       DB2PRG DESCRIPTION        ║
  128. *  ╙─────────────────────────────────╜
  129.  
  130. *  While developing applications, use CREATE and MODIFY STRUCTURE as usual
  131. *  to create and modify data file structures.
  132.  
  133. *  Just before distributing your application, use DB2PRG.PRG.  The most
  134. *  current structure of each DBF will be recorded in the MAKEDBF.PRG 
  135. *  generated.
  136.  
  137. *  DB2PRG.PRG does not need to be distributed with an application, only
  138. *  the MAKEDBF.PRG it creates need be distributed with your application.
  139.  
  140. *  Your applications could use the following code in it's initialization
  141. *  process to let it know if it needs to DO MAKEDBF:
  142. *
  143. *    mmakedbf = .NOT. FILE('myfile1.dbf')
  144. *    mmakedbf = mmakedbf .OR. .NOT. FILE('myfile2.dbf')
  145. *    mmakedbf = mmakedbf .OR. .NOT. FILE('myfile3.dbf')
  146. *    * ... and so forth for every dbf file in the application
  147. *    IF mmakedbf
  148. *       DO makedbf
  149. *       * makedbf will only create missing files.
  150. *       * makedbf will never overwrite any dbf files that already exist.
  151. *       DO reindex    && application specific reindexing procedure you supply
  152. *    ENDIF
  153.  
  154. *  The author acknowledges John Bauman for his article "DBF'S ON THE FLY" in
  155. *  the August 1989 DATA BASED ADVISOR.  The article ably proved the value of
  156. *  DBF from scratch capabilities.  DB2PRG has incorporated adaptations of
  157. *  some of the methodologies described in John's article.
  158.  
  159. *  ╓─────────────────────────────────╖
  160. *  ║        GETTING STARTED          ║
  161. *  ╙─────────────────────────────────╜
  162.  
  163. * The DB2PRG system and documentation is completely contained in the
  164. * Fox executable program file DB2PRG.PRG.  There are no other files
  165. * needed to start DB2PRG.  Simply copy DB2PRG.PRG wherever it is
  166. * convenient to keep it.  Normally DB2PRG.PRG is installed in a 
  167. * subdirectory below the Fox Software program (FoxPro or FoxBASE+) 
  168. * such as C:\FOX\GOODIES.
  169.  
  170. * The PATH to that subdirectory (such as C:\FOX\GOODIES) should be 
  171. * included in a PATH= statement in the CONFIG.FP or CONFIG.FX file.
  172. * See the Fox User Guide for more information on the CONFIG file.
  173. * In addition, a DOS PATH to the subdirectory of the Fox Software
  174. * program (FoxPro or FoxBASE+) such as C:\FOX should be in effect. 
  175. * This can be done by typing PATH C:\FOX at any DOS command prompt,
  176. * in the AUTOEXEC.BAT file, and/or in any batch file or other system
  177. * you use to start the Fox Software system.
  178.  
  179. * Set up this way, no matter what disk or directory you start out from
  180. * on your computer, entering FOXPRO DB2PRG or FOXPLUS DB2PRG at any DOS 
  181. * command prompt will get both FoxPro or FoxBASE+ and DB2PRG started 
  182. * with just a single command.
  183.  
  184. * Or, if you would like to start the Fox Software system first, and then
  185. * later start DB2PRG when inside the Fox environment:
  186.  
  187. * 1. Be in the subdirectory of the DBF files to be used.
  188.  
  189. * 2. Start FoxPro or FoxBASE+.
  190.  
  191. * 3. If you have DB2PRG.PRG in some other sub-directory, SET a PATH to it
  192. *    or specify the full path name in the next instruction.
  193.  
  194. * 4. Enter the command: DO DB2PRG.
  195.  
  196. * 5. Choose PROCEED from the main menu.
  197.  
  198. * 6. The file MAKEDBF.PRG will be created in the current directory.
  199.  
  200. *  ╓─────────────────────────────────╖
  201. *  ║     DB2PRG RELEASE HISTORY      ║
  202. *  ╙─────────────────────────────────╜
  203.  
  204. * Version 1.0  7/19/1990 first release
  205.  
  206. * Version 2.0  3/16/1991 enhancements
  207. *              DBF file creation without KEYBOARD (FoxPro only)
  208. *              Using SYS(2000) to get dbf file names eliminates 2 temp files
  209. *              Corrected improper SYS(3) implementation
  210. *              Colors selected for FoxPro and FoxBASE+
  211. *              Additional code commenting and spacing
  212.  
  213. * Version 2.1  6/30/1991 enhancement
  214. *              Traps error when attempting to USE invalid user dbf files
  215. *              First release as shareware.  $10 registration fee.
  216.  
  217. *  ╓─────────────────────────────────╖
  218. *  ║         OTHER PRODUCTS          ║
  219. *  ╙─────────────────────────────────╜
  220.  
  221. *       File: QQUERY.ZIP
  222.  
  223. *      Title: Elaborate Query manager for FoxPro & FoxBASE+ 
  224.  
  225. *   Keywords: QQUERY 2.10D 5/19/90 ASP SHAREWARE $10.00 FOX
  226.  
  227. *  QQuery helps users create, store, modify, and replay logical
  228. *  expressions. When combined with Fox or 3rd party report
  229. *  generators, QQuery makes a simple yet powerful query tool.
  230.  
  231. *  For Fox database application developers, QQuery can add
  232. *  powerful, reusable, ad hoc record selection to combine with
  233. *  developer designed data and report formats. QQuery has a
  234. *  complete online help system. Registered users receive source
  235. *  code and the right to use QQuery in their distributed
  236. *  applications.
  237.  
  238.  
  239. *       File: DB2DOC.ZIP
  240.  
  241. *      Title: Automatic DBF documentation for FoxPro/FB+
  242.  
  243. *   Keywords: DB2DOC 2.0 6/30/91 ASP SHAREWARE $10.00 FOX
  244.  
  245. *  DB2DOC inspects all DBF files in the current directory and
  246. *  quickly generates/updates a FoxBASE+/FoxPro dbf file,
  247. *  "DB2DOC.ddb".  Menus are provided to BROWSE the documentation
  248. *  database to add application, file, and field descriptions, and
  249. *  record counts.
  250.  
  251. *  DB2DOC generates file and field descriptions and statistics to
  252. *  screen, printer, or disk file for any or all dbf files.  Source
  253. *  included from QQUERY & DB2PRG author Carlos Berguido.
  254.  
  255. *  ╓─────────────────────────────────╖
  256. *  ║       DB2PRG SOURCE CODE        ║
  257. *  ╙─────────────────────────────────╜
  258.  
  259. * BEGIN db2prg.prg
  260.  
  261. PRIVATE massign, mmessage, mtalk, msafe, mscore, mstatus,;
  262.         mcolor, mtitle, mscreen, mchoice, mfile, fstruct, mrow
  263.  
  264. * Turn off screen output and cursor
  265. SET CONSOLE OFF
  266. massign = SYS(2002)
  267.  
  268. * Save environment
  269. mmessage = SYS(2001,'MESSAGE')   
  270. mtalk    = SYS(2001,'TALK')       = 'ON'
  271. msafe    = SYS(2001,'SAFETY')     = 'ON'
  272. mscore   = SYS(2001,'SCOREBOARD') = 'ON'
  273. mstatus  = SYS(2001,'STATUS')     = 'ON'
  274.  
  275. * Set environment for this program
  276. SET MESSAGE TO 23
  277. SET TALK OFF
  278. SET SAFETY OFF
  279. SET SCOREBOARD OFF
  280. SET STATUS OFF
  281. IF ISCOLOR()
  282.    mcolor = SYS(2001,'COLOR')
  283.    SET COLOR TO W+/B,RG+/W,W
  284.    IF "FOXPRO" $ UPPER(VERSION())
  285.       ACTIVATE SCREEN
  286.       SET COLOR OF SCHEME 2 TO ,W+/B,,,W+/B,RG+/W
  287.    ENDIF
  288. ENDIF
  289.  
  290. * Paint screen frame and save it
  291. CLEAR
  292. mtitle = '(c) Carlos Berguido 1990, 1991                               All Rights Reserved'
  293. @  0, 0 GET mtitle
  294. mtitle = 'Version 2.1                      D B 2 P R G                     Release 6/30/91'
  295. @ 22, 0 GET mtitle
  296. CLEAR GETS
  297. SAVE SCREEN TO mscreen
  298.  
  299. * Sign on help screen:
  300. @ 1,0 SAY ''
  301. SET CONSOLE ON
  302. TEXT
  303.    DB2PRG provides a quick and easy way to enhance your FoxPro or FoxBASE+
  304.    applications.  DB2PRG automates the task of creating all the DBF file 
  305.    structures needed by your application.
  306.  
  307.    If you choose to "Proceed", DB2PRG will search the current directory and 
  308.    quickly generate a program file, "makedbf.prg", containing the commands 
  309.    needed to create all of any of the DBF files DB2PRG found.  You may add
  310.    "DO makedbf" to the initialization process of your application.  See the
  311.    DB2PRG source code for details.
  312.  
  313.    DB2PRG is distributed using the "shareware" method of distribution.  It
  314.    is not free software.  Continued use after a reasonable evaluation period
  315.    requires a $10 registration fee.  See the DB2PRG source code for details.
  316.  
  317.         Carlos Berguido                 Author of FB+ and FoxPro utilities
  318.         1722 Capella Court                  QQUERY - $10 shareware
  319.         Petaluma, CA 94954                  DB2PRG - $10 shareware
  320.         (707) 762-9067                      DB2DOC - $10 shareware
  321.  
  322.  
  323. ENDTEXT
  324.  
  325. * Light bar menu:
  326. @ 24, 0 PROMPT 'Cancel'  MESSAGE 'Cancel this program'
  327. @ 24,10 PROMPT 'Proceed' MESSAGE 'Create or replace the program file MAKEDBF.PRG in the current directory'
  328. MENU TO mchoice
  329.  
  330. IF mchoice = 2
  331.    * make sure that all dbf files are closed
  332.    CLOSE DATABASES
  333.    SET CONSOLE OFF  && output to screen from RESTORE and @ r,c SAY only
  334.  
  335.    RESTORE SCREEN from mscreen
  336.    @ 2, 0 SAY 'Filename  Fields'
  337.    @ 3, 0 SAY REPL(CHR(223),80)
  338.  
  339.    mfile = SYS(2000,'*.dbf')
  340.  
  341.    IF LEN(mfile) = 0
  342.       @ 11,12 SAY 'No DBF files were found - Makedbf.prg was not created.'
  343.       @ 24,30 SAY 'Strike any key to exit '
  344.    ELSE
  345.       * Create makedbf.prg file
  346.       SET ALTERNATE TO makedbf.prg
  347.       SET ALTERNATE ON
  348.       ?? '* MAKEDBF.PRG  Creates missing dbf files.  Requires FoxBASE+ or FoxPro.'
  349.       ?  '*              This program code was generated by DB2PRG.prg on', DATE()
  350.       ? 'PRIVATE mscreen, mprinter, mprint, mtalk, msafe, mscore, mstatus,;'
  351.       ? '        fstrutxt, fstrudbf'
  352.       ?
  353.       ? '* Save environment'
  354.       ? 'SAVE SCREEN TO mscreen'
  355.       ? 'SET CONSOLE OFF'
  356.       ? 'mprinter= SYS(2001,"PRINT",1)'
  357.       ? 'mprint  = SYS(2001,"PRINT")       = "ON"'
  358.       ? 'mtalk   = SYS(2001,"TALK")        = "ON"'
  359.       ? 'msafe   = SYS(2001,"SAFETY")      = "ON"'
  360.       ? 'mscore  = SYS(2001,"SCOREBOARD")  = "ON"'
  361.       ? 'mstatus = SYS(2001,"STATUS")      = "ON"'
  362.       ?
  363.       ? '* Set environment for this program'
  364.       ? 'SET TALK OFF'
  365.       ? 'SET SAFETY OFF'
  366.       ? 'SET SCOREBOARD OFF'
  367.       ? 'IF mstatus'
  368.       ? '   SET STATUS OFF'
  369.       ? 'ENDIF'
  370.       ?
  371.       ? '* Obtain 2 unique filenames'
  372.       ? 'fstrutxt = SYS(3)+".txt"'
  373.       ? 'fstrudbf = SYS(3)+".dbf"'
  374.       ?
  375.       ? '* Create a seed dbf file for STRUCTURE EXTENDED'
  376.       ? 'IF "FOXPRO" $ UPPER(VERSION())'
  377.       ? '   SET PRINTER TO &fstrudbf'
  378.       ? '   SET PRINT ON'
  379.       ? '   ?? CHR(3)+"["+CHR(3)+CHR(6)+REPL(CHR(0),4)+CHR(161)+CHR(0)+CHR(18)'
  380.       ? '   ?? REPL(CHR(0),21)'
  381.       ? '   ?? "FIELD_NAME" + CHR(0)          + "C" + CHR(1)  + REPL(CHR(0),3)'
  382.       ? '   ?? CHR(10) + REPL(CHR(0),15)'
  383.       ? '   ?? "FIELD_TYPE" + CHR(0)          + "C" + CHR(11) + REPL(CHR(0),3)'
  384.       ? '   ?? CHR(1) + REPL(CHR(0),15)'
  385.       ? '   ?? "FIELD_LEN"  + CHR(0) + CHR(0) + "N" + CHR(12) + REPL(CHR(0),3)'
  386.       ? '   ?? CHR(3) + REPL(CHR(0),15)'
  387.       ? '   ?? "FIELD_DEC"  + CHR(0) + CHR(0) + "N" + CHR(15) + REPL(CHR(0),3)'
  388.       ? '   ?? CHR(3) + REPL(CHR(0),15) + CHR(13) + CHR(26)'
  389.       ? '   SET PRINT OFF'
  390.       ? '   * restore original printer port assignment'
  391.       ? '   SET PRINTER TO &mprinter'
  392.       ? 'ELSE'
  393.       ? '   * if FoxBASE+, use the CREATE user interface'
  394.       ? '   CLEAR TYPEAHEAD'
  395.       ? '   KEYBOARD "FIELD_NAME"          + "C10" +CHR(13)'
  396.       ? '   KEYBOARD "FIELD_TYPE"          + "C1"  +CHR(13)'
  397.       ? '   KEYBOARD "FIELD_LEN" + CHR(13) + "N3"  +CHR(13)+"0"+CHR(13)'
  398.       ? '   KEYBOARD "FIELD_DEC" + CHR(13) + "N3"  +CHR(13)+"0"+CHR(13)+CHR(13)+CHR(13)+"N"'
  399.       ? '   CREATE &fstrudbf'
  400.       ? '   RESTORE SCREEN FROM mscreen'
  401.       ? 'ENDIF'
  402.       ?
  403.       ? '* Draw alert box to display dbf file name being created'
  404.       ? '@ 10,29 CLEAR TO 12,50'
  405.       ? '@ 10,29 TO 12,50 DOUBLE'
  406.       ? '@ 11,31 SAY "Creating: "'
  407.  
  408.       * get a unique filename for a temporary dbf file
  409.       fstruct = SYS(3) + ".dbf"
  410.       mrow    = 0
  411.       DO WHILE LEN(mfile) > 0 
  412.  
  413.          * Display the dbf file name on the screen
  414.          mfile = LOWER(LEFT(mfile,AT('.',mfile)-1))
  415.          mrow  = MOD(mrow,17)
  416.          @ mrow + 4, 0 CLEAR TO mrow + 5,79
  417.          @ mrow + 4, 0 SAY mfile
  418.  
  419.          * Make a STRUCTURE EXTENDED version of the dbf file
  420.          not_open = .F.
  421.          ON ERROR not_open = .T.
  422.          USE &mfile
  423.          ON ERROR
  424.          SET CONSOLE OFF
  425.  
  426.          IF not_open
  427.             @ mrow + 4,10 SAY 'ERROR: Can not open file'
  428.          ELSE
  429.             COPY TO &fstruct STRUCTURE EXTENDED
  430.             USE &fstruct
  431.  
  432.             * Generate the makedbf lines for the file
  433.             ?
  434.             ? 'IF .NOT. FILE("&mfile..dbf")'
  435.             ? '   @ 11,41 CLEAR TO 11,49'
  436.             ? '   @ 11,41 SAY UPPER("&mfile")'
  437.             ? '   SET ALTERNATE TO &fstrutxt'
  438.             ? '   SET ALTERNATE ON'
  439.             ? '   TEXT'
  440.             DO WHILE .NOT. EOF()
  441.                @ mrow + 4, 10 SAY REPL(CHR(254),MOD(RECNO(),71))
  442.                ? field_name + field_type + STR(field_len,3) + STR(field_dec,3)
  443.                SKIP
  444.             ENDDO
  445.             ? '   ENDTEXT'
  446.             ? '   CLOSE ALTERNATE'
  447.             ? '   USE &fstrudbf'
  448.             ? '   ZAP'
  449.             ? '   APPEND FROM &fstrutxt SDF  FOR field_name<>" "'
  450.             ? '   USE'
  451.             ? '   CREATE &mfile. FROM &fstrudbf'
  452.             ? 'ENDIF'
  453.  
  454.             * get rid of the temp file so SYS(2000) won't see it
  455.             USE
  456.             DELETE FILE &fstruct
  457.          ENDIF
  458.  
  459.          * get next dbf file name, nul string when there are no more
  460.          mfile = SYS(2000,'*.dbf',1)
  461.          mrow  = mrow + 1
  462.       ENDDO
  463.       ?
  464.       ? '* Erase the temporary files'
  465.       ? 'USE'
  466.       ? 'DELE FILE &fstrudbf'
  467.       ? 'DELE FILE &fstrutxt'
  468.       ?
  469.       ? '* Restore the environment'
  470.       ? 'IF mprint'
  471.       ? '   SET PRINT ON'
  472.       ? 'ENDIF'
  473.       ?
  474.       ? 'IF msafe'
  475.       ? '   SET SAFETY ON'
  476.       ? 'ENDIF'
  477.       ?
  478.       ? 'IF mscore'
  479.       ? '   SET SCOREBOARD ON'
  480.       ? 'ENDIF'
  481.       ?
  482.       ? 'IF mstatus'
  483.       ? '   SET STATUS ON'
  484.       ? 'ENDIF'
  485.       ?
  486.       ? 'IF mtalk'
  487.       ? '   SET TALK ON'
  488.       ? 'ENDIF'
  489.       ?
  490.       ? 'RESTORE SCREEN FROM mscreen'
  491.       ? 'SET CONSOLE ON'
  492.       ?
  493.       ? 'RETURN'
  494.       ?
  495.  
  496.       CLOSE ALTERNATE
  497.  
  498.       @ 24,20 SAY 'Makedbf.prg created.  Strike any key to exit '
  499.  
  500.    ENDIF
  501.  
  502. ENDIF
  503.  
  504. * Restore cursor
  505. massign = SYS(2002,1)
  506.  
  507. IF mchoice = 2
  508.    * Wait with files closed
  509.    massign = INKEY(0)
  510.    @ 24, 0 CLEAR TO 24,79
  511. ENDIF
  512.  
  513. * Restore environment
  514. IF ISCOLOR()
  515.    SET COLOR TO &mcolor
  516.    IF "FOXPRO" $ UPPER(VERSION())
  517.       SET COLOR OF SCHEME 2 TO
  518.    ENDIF
  519. ENDIF
  520.  
  521. SET MESSAGE TO VAL(mmessage)
  522.  
  523. IF msafe
  524.    SET SAFETY ON
  525. ENDIF
  526.  
  527. IF mtalk
  528.    SET TALK ON
  529. ENDIF
  530.  
  531. IF mstatus
  532.    SET STATUS ON
  533. ENDIF
  534.  
  535. IF mscore
  536.    SET SCOREBOARD ON
  537. ENDIF
  538.  
  539. SET CONSOLE ON
  540.  
  541. RETURN
  542.  
  543. * EOF db2prg.prg
  544.